<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-demo__xlslogcash}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission('demo:xlslogcash:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission('demo:xlslogcash:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="id" label="账户流水主键" header-align="center" align="center"></el-table-column>
        <el-table-column prop="type" label="现金类型 1,消费账户 2.现金账户 3.伯乐收益 4.批发收益 5.线下充值.6手动补单现金 7.手动补单消费,8消费转现金,9现金转消费,10现金提现到银行卡,11提现拒绝,12使用优惠券,13批发消费减少,14批发消费增加 ,15等级级差奖励,16奖励转现金,17代理奖励,18库存转交易余额，19交易余额记录 20 销售奖,21手动补单奖励，22手动补单交易，23手动补单团队业绩24奖励账户提现手续费25奖励账户提现26消费账户提现27消费账户提现费用28提现额度控制29手续费退回,30领导奖" header-align="center" align="center"></el-table-column>
        <el-table-column prop="fromId" label="发起用户ID 0为平台" header-align="center" align="center"></el-table-column>
        <el-table-column prop="userId" label="目标用户ID 0为平台" header-align="center" align="center"></el-table-column>
        <el-table-column prop="orderNo" label="对应订单号" header-align="center" align="center"></el-table-column>
        <el-table-column prop="preCash" label="操作前的金额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="cashType" label="流水标志 -1减少 1增加" header-align="center" align="center"></el-table-column>
        <el-table-column prop="cash" label="变动金额" header-align="center" align="center"></el-table-column>
        <el-table-column prop="remark" label="备注" header-align="center" align="center"></el-table-column>
        <el-table-column prop="dataFlag" label="有效状态 1有效-1删除" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createTime" label="创建时间" header-align="center" align="center"></el-table-column>
        <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
          <template slot-scope="scope">
            <el-button v-if="$hasPermission('demo:xlslogcash:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
            <el-button v-if="$hasPermission('demo:xlslogcash:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './xlslogcash-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/demo/xlslogcash/page',
        getDataListIsPage: true,
        exportURL: '/demo/xlslogcash/export',
        deleteURL: '/demo/xlslogcash',
        deleteIsBatch: true
      },
      dataForm: {
        id: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
